﻿@using SmartSiteManagementSystem.Models.WorkTask;
@using SmartSiteManagementSystem.IServices;
@inject IWorkTaskService _workTaskService
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.BodyClass = "easyui-layout";
     DemandingPlaceInfo demandingPlaceInfo = ViewBag.demandingPlaceInfo;
}
    <div class="easyui-panel" style="padding:5px;">    
        <input id="DemandingPlaceId" type="hidden" value="@demandingPlaceInfo.DemandingPlaceId" />
        <table class="gou-formTable" style="align-content:center;">
            <tbody>              
                <tr>
                    <td align="right" class="gou-formTable-title" style="width:160px;">*需求地名称:</td>
                    <td align="left" class="">
                         <input id="SetName" name="DemandingPlaceName" type="text" value="@demandingPlaceInfo.DemandingPlaceName" />    
                    </td>
                </tr>
                    

                <tr>
                    <td align="right" class="gou-formTable-title">描述:</td>
                    <td align="left" class="">
                        <input id="Descript" name="Descript" type="text" value="@demandingPlaceInfo.Descript" />

                    </td>
                </tr>

                  <tr>
                    <td align="right" class="gou-formTable-title">坐标:</td>
                    <td align="left" class="">
                       X: <input id="PositionX" name="PositionX" type="text" value="@demandingPlaceInfo.PositionX" />
                         Y: <input id="PositionY" name="PositionY" type="text" value="@demandingPlaceInfo.PositionY" />
                         Z: <input id="PositionZ" name="PositionZ" type="text" value="@demandingPlaceInfo.PositionZ" />

                    </td>
                </tr>



                <tr>
                    <td colspan="2" align="center">                       
                            <a href="javascript:void(0)" id="hfSave" class="easyui-linkbutton" iconcls="icon-save" onclick="Save();" style="width:150px;height:32px">保存</a>                                           
                    </td>
                </tr>
            </tbody>
        </table>

    </div>



    <script type="text/javascript">        


        //保存
        function Save() {

            //验证必选项******************************************************************
            var DemandingPlaceName = $("#DemandingPlaceName").val();
            if (DemandingPlaceName == "") {
                $.messager.alert('提示', '供应地名称为必填项!');
                return false;
            }
            var Descript = $("#Descript").val();
            var DemandingPlaceId = $("#DemandingPlaceId").val();
            
           var PositionX = $("#PositionX").val();
           var PositionY = $("#PositionY").val();
           var PositionZ = $("#PositionZ").val();
         


            
            var param = { DemandingPlaceId: DemandingPlaceId, DemandingPlaceName: DemandingPlaceName,PositionX:PositionX,PositionY:PositionY,PositionZ:PositionZ,Descript: Descript};
            $.ajax({
                "type": "Post",
                "url": "ajaxAddOrEditDemandingPlace?t=" + new Date().getTime(),
                "dataType": "json",
                "data": param,
                "success": function (data) {
                    if (data.Code == 1) {
                        window.location.href = "DemandingPlaceIndex";
                    }
                    else
                    {
                        $.messager.alert('提示', data.Msg);
                    }
                }
            });
        }
</script>    
